Plex.Lib.CSS.load('UI.Input.Toolbar');

Plex.UI.Input.Toolbar = function(title)
{
	var self = this;
	
	this.el = {};
	this.el.toolbarDiv = new Element('div',{
		'class':'Toolbar'
	})
	this.el.titleDiv = new Element('div',{
		'class':'Title'
	}).setText(title).injectInside(this.el.toolbarDiv);
	
	this.addButton = function(title,action,image)
	{
		var button = new Element('input',{
			'class':image?'Button':'ButtonNoImage',
			'type':'button',
			'value':title,
			'events':{
				'click':action?action:function(){
					
				}
			}
		})
		
		button.injectInside(self.el.toolbarDiv);
	}
	
	this.addSeperator = function()
	{
		var seperator = new Element('b').setHTML("&nbsp;&nbsp;|&nbsp;");
		seperator.injectInside(self.el.toolbarDiv);
	}
	
	this.setTitle = function(value)
	{
		self.el.titleDiv.setText(value);
	}
	
	this.open = function()
	{
		self.el.toolbarDiv.style.zIndex = (Plex.UI.zIndex++)+30000;
		self.el.toolbarDiv.injectInside(document.body);
	}
	
	this.close = function()
	{
		Plex.S$.remove(self.el.toolbarDiv);
	}
	
	this.focus = function()
	{
		self.el.toolbarDiv.style.zIndex = (Plex.UI.zIndex++)+30000;
	}
}
